/*------------------------------------------------------------------------------

 Copyright 2007 Luc Fourestier

 The copyright to the computer program(s) herein is the property of Luc
 Fourestier. The program(s) may be used and/or copied only with the written
 permission of Luc Fourestier or in accordance with the terms and conditions
 stipulated in the agreement/contract under which the program(s) have been
 supplied.

 Contact: luc.fourestier@gmail.com

------------------------------------------------------------------------------*/
/**
 @file    context.h

    This module provides the MIPS dedicated context API.

 @author  Luc Fourestier
 @version 0.1
 @date    10/2007

*/
/*----------------------------------------------------------------------------*/

#ifndef CONTEXT_H
#define CONTEXT_H


/*------------------------------------------------------------------------------
 Includes
------------------------------------------------------------------------------*/

/* mandatory include file for the following definitions */
#include "colibri.h"


/*------------------------------------------------------------------------------
 Typedefs
------------------------------------------------------------------------------*/

/** this structure is the type defintition of the context to be saved for the MIPS
 processor */

typedef struct Context_Struct
{
    void * sp; /* the stack pointer */
    void * fp; /* the stack frame pointer */
    void * ra; /* the return address register */
    void * gp; /* the global pointer */
} ContextStruct_t;


/*------------------------------------------------------------------------------
 Functions
------------------------------------------------------------------------------*/

/**
 @brief  Switch from one context to another
*/
void context_Switch(void * TaskStruct1, void * TaskStruct2);


#endif /* CONTEXT_H */
